package com.huluwa.chat;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import org.junit.jupiter.api.Test;

import java.io.IOException;

/**
 * @Classname HeroInfo
 * @Date 2024-12-28 16:03
 * @Created by luyifan
 */
public class HeroInfo
{
    @Test
    public static void main(String[] args) throws IOException {
        Document document = Jsoup.connect("https://www.op.gg/champions").header("Accept-Language", "zh-CN,zh;q=0.9").get();
        Elements ulList= document.getElementsByClass("grid grid-cols-6 gap-2");
        Element ulEle = ulList.get(0);
        System.out.println(ulEle);
        Elements heroInfoList  = ulEle.getElementsByTag("li");
        for (Element element : heroInfoList) {
            System.out.println(element);
        }
    }

    @Test
    public static void chat() throws IOException {
        Document document = Jsoup.connect("https://www.op.gg/champions").header("Accept-Language", "zh-CN,zh;q=0.9").get();
        Elements ulList= document.getElementsByClass("grid grid-cols-6 gap-2");
        Element ulEle = ulList.get(0);
        System.out.println(ulEle);
        Elements heroInfoList  = ulEle.getElementsByTag("li");
        for (Element element : heroInfoList) {
            System.out.println(element);
        }
    }
}
